The present invention relates to an image-processing apparatus for processing an image signal and an image-pickup apparatus having the function of the image-processing apparatus. More particularly, the present invention relates to an image-processing apparatus suitable for processing of an image signal representing an image taken by using a solid-state image-pickup device of an XY address scanning type and relates to an image-pickup apparatus having the function of such an image-processing apparatus.
When an object of photographing is photographed in illumination of a blinking light source such as a fluorescent lamp driven by a commercial alternating-current power supply by using a video camera, due to a difference between the frequency of the luminance change (or the light-quantity change) of the light source and the vertical synchronization frequency of the camera, brightness/darkness changes are generated along the time axis. The brightness/darkness changes are referred to as the so-called fluorescent flickers. In particular, if an image-pickup device of the XY address scanning type is used, the exposure timing varies from horizontal line to horizontal line so that flickers on a taken image are observed as a pattern caused by a luminance level periodically changing in the vertical direction or a pattern caused by variations in hue. An example of the image-pickup device of the XY address scanning type is a CMOS (Complementary Metal Oxide Semiconductor).
As a technique for eliminating such flicker components from a signal representing a taken image, a shutter correction method and a gain correction method are generally known. The shutter correction method is a correction method based on relations between the speed of the shutter and the level of flickers. On the other hand, the gain correction method is a method for detecting the waveform of flickers and using the inverted waveform of the detected waveform as a correction gain to be applied to a signal representing an image. In accordance with a flicker reduction method based on the gain correction method, changes of the level of a signal representing an image are subjected to a frequency analysis to detect a spectrum of the flicker frequency and the level of a signal representing an image is then corrected on the basis of the amplitude of the spectrum. For more information on this flicker reduction method, the reader is suggested to refer to Japanese Patent Laid-open No. 2004-222228, which is explained in paragraphs [0072] to [0111] with reference to FIG. 4.
FIG. 21 is an explanatory diagram referred to in describing an outline of the conventional flicker detection procedure. As shown in FIG. 21, the flicker reduction method disclosed in Japanese Patent Laid-open No. 2004-222228 includes:
a step S11 of sampling one period of a flicker waveform while converting an input signal representing an image into a signal having a proper form;
a step S12 of computing a frequency spectrum of flicker components composing the one period of a flicker waveform as a fundamental waveform by application of a DFT (Discrete Fourier Transform) process to the sampled data; and
a step S13 of inferring a flicker waveform by using only low-order terms of the spectrum.
At the step S11 of sampling the one period of a flicker waveform, to put it concretely, the signal representing an image is sequentially integrated typically for each line oriented in the horizontal direction in order to reduce effects of the picture. In the DFT processing carried out at the step S12, an average of integration values obtained over a plurality of fields is found and the average is used for normalizing the integration values in order to make luminance changes caused by flickers in a screen area match changes in colors. By carrying out such processing, the flicker waveform can be detected with a high degree of accuracy independently of the photographing object and the level of the signal representing an image.
By the way, in recent years, the number of pixels on an image-pickup device employed in a video camera or a similar apparatus has been increasing fast. That is to say, the number of lines oriented in the horizontal direction has increased from several hundreds to several thousands. In consequence, if the integration values obtained for all the lines in a process to sample one period of a flicker waveform are all used, the size of a processing circuit including a memory for storing the integration values and a DFT processing circuit also rises inevitably.
On the other hand, in the case of the NTSC (National Television Standards Committee) system, for example, the period of the waveform of flickers generated by a fluorescent lamp is shorter than the length of one vertical synchronization period so that the flickers appear on one screen as several stripes. Thus, by consideration from the sampling theorem, the number of sampling points on L lines corresponding to one period of the flicker waveform is redundant. That is to say, several tens of points taken from the one period of the flicker waveform as sampling points are a number large enough for providing sufficient detection precision. For example, 64 sampling points are sufficient. Thus, in an actual flicker detection process, the processing to sample one period of the flicker waveform is carried out by thinning data being sampled in the vertical direction so as to reduce the size of the processing circuit.
FIG. 22 is an explanatory diagram referred to in describing an outline of a flicker detection procedure executed to thin data being sampled.
The procedure shown in FIG. 22 begins with a step S21 at which L lines corresponding to one period of the flicker waveform are sampled from an input signal representing an image to generate L pieces of sampling data in a way similar to the step S11 of the procedure shown in FIG. 21. Then, at the next step S22, the L pieces of sampling data are thinned down to output L1 pieces of sampling data where the numbers L and L1 satisfy the following relation: L>>L1. As a thinning technique, it is possible to adopt a thinning method for simply outputting one piece of thinned sampling data for every predetermined period or outputting one piece of thinned sampling data by carrying out a process taking a predetermined number of pieces of input sampling data as a base. An example of the process is an LPF (Low Pass Filter) process. Then, at the next step S23, pieces of sampling data at the L1 points are subjected to a DFT process in the same say as the procedure shown in FIG. 21. Subsequently, at the next step S24, a flicker waveform is inferred from a result of a frequency analysis. The processing as above described can reduce a capacity of a memory which retains sampling data for carrying out DFT processing.
By the way, in accordance with the flicker detection method described above, by taking just one period of a flicker waveform as a sampling unit of the flicker waveform on the basis of the sampling theorem, the flicker waveform can be detected with a high degree of accuracy. If a line is sampled by thinning the line at a fixed rate of L/L1, however, it is no longer possible to accurately sample a period equivalent to one period of a flicker waveform unless the value of L/L1 is an integer. For this reason, a frequency spectrum array obtained from sampling values for such a case is different from that obtained as a result of a Fourier series expansion applied to the conventional flicker waveform with one period of a sinusoidal waveform. Thus, a detection error is inevitably generated.
In order to avoid such a detection error, it is necessary to design the processing circuit so as to provide a proper thinning unit according to the number of lines composing the image-pickup device employed in the image-pickup apparatus. In recent years, however, for the purpose of reducing the cost and other purposes, there is a demand for a processing circuit that can be used as a circuit common to a variety of products or a processing circuit capable of keeping up with future changes in specification with ease, and such a demand is also raised as a demand for a circuit for detection of flickers. To be more specific, there is also a demand for a flicker detection circuit that can be used as a circuit common to products having different numbers of pixels composing the image-pickup device employed in each of the products and is capable of avoiding a detection error described above without much changing the configuration of the circuit.